<template>
  <div class="wrapper" ref="wrapper">
    <div class="content">
      <slot></slot>
    </div>
    <!-- 这里可以放一些其它的 DOM，但不会影响滚动 -->
  </div>
</template>
<script>
import BScroll from "better-scroll";
export default {
  data() {
    return {
      scroll: null
    };
  },
  mounted() {
    this.scroll = new BScroll(this.$refs.wrapper, {
      probeType: 3,
      pullUpLoad: true,
      click: true
    });
    console.log(this.scroll);
    //监听滚动的位置
    // this.scroll.on('scroll',(position)=>{
    //     console.log(position);
    // }) 
    this.scroll.on("pullingUp", () => {
      console.log("上拉事件");
      this.scroll.finishPullUp();
      // this.scroll.refresh();
    });
    
  }
};
</script>
<style lang="less" scoped>
.wrapper {
  height: 100vh;
  // background-color: aquamarine;
  overflow: hidden;
}
.content {
  height: calc(100%-93px);
  // overflow: hidden;
  padding-bottom: .49rem;

}
</style>